<template>
    <div id="app">
        <input v-model="searchStr">
        <div>
            <div class="item" v-for="item in list.filter(item => {return item.userName.includes(searchStr)})">{{item.employeeId}} {{item.userName}} {{item.roleName}}  </div>
        </div>
    </div>
</template>
<script>
export default {
    name: 'app',
    data(){
        return {
            searchStr: '',
            list: []
        }
    },
    mounted(){
        this.http_listAllUsers()
    },
    methods: {
        http_listAllUsers(){
            this.$axios.post('http://168.168.2.10:8080/sacn/user/findBy',
                {
                    pageNum: "1",
                    pageSize: "1500"
                }
            ).then(res => {
                console.log('数据是:', res);
                this.list = res.data.data.list
            }).catch((e) => {
                console.log('获取数据失败');
            });
        }
    }
}
</script>
<style scoped>
#app {
    width: 420px;
    height: auto;
    font-family: 'Avenir', Helvetica, Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-align: center;
    color: #333;
    background: #f5f5f5;
}
</style>
